import React, { useEffect } from 'react';
import { Button } from 'antd';
import { messageCenter } from '@/app/common/utils';

export default function SysPost() {
  messageCenter.on('test', (d: any) => {
    console.log(d, '消息中心');
  });

  useEffect(() => {
    $get('/system/menu/list').then(res => {
      console.log(res, '岗位管理页面的请求');
    });
  }, []);

  const emit = () => {
    messageCenter.emit('test', 'test');
  };
  return (
    <div>
      <Button onClick={emit}>发送</Button>
    </div>
  );
}
